<html>
  <?php
  
  
  
ob_start();
phpinfo();
$variable = ob_get_contents();
ob_get_clean();

if ( strpos( $variable, "?=PHP" ) > 0 )
{

  #echo strpos( $variable, "?=PHP" );
  $variable = str_insert_all( "http://php.net/", $variable, "?=PHP" );
}

echo $variable;


function str_insert_all( $insertstring, $intostring, $findstring )
{
  $pos = 0;
  while( true )
  {
    $pos = strpos( $intostring, $findstring, $pos );
    #echo sprintf( "here->> %d ",$pos);
    if ( $pos == false )
    {
      #echo "!!";
      break;
    }
    
    $intostring = str_insert( $insertstring, $intostring, $pos );
    
    $pos += strlen( $insertstring ) + 1;
  }
  
  return $intostring;
}


// $insertstring - the string you want to insert
// $intostring - the string you want to insert it into
// $offset - the offset

function str_insert($insertstring, $intostring, $offset) {
   $part1 = substr($intostring, 0, $offset);
   $part2 = substr($intostring, $offset);
  
   $part1 = $part1 . $insertstring;
   $whole = $part1 . $part2;
   return $whole;
}

    ?>
</html>